import {InsertTextOperation} from "../../operations";
import Editor from "../../editor";

export function toUpperCase(editor: Editor) {
    const originApply = editor.apply.bind(editor)
    editor.apply = function (operation) {
        if (operation instanceof InsertTextOperation) {
            operation.spacers_ = operation.spacers_.toUpperCase()
        }
        originApply(operation)
    }
    return editor
}